package hotciv.factories;

import hotciv.common.CityImpl;
import hotciv.common.UnitImpl;
import hotciv.framework.City;
import hotciv.framework.GameConstants;
import hotciv.framework.Player;
import hotciv.framework.Position;
import hotciv.framework.TileMap;
import hotciv.framework.Unit;
import hotciv.variants.DeltaTileMap;

import java.util.HashMap;

public class DeltaCivFactory extends AlphaCivFactory {
	private TileMap tileMap;
	private HashMap<Position, Unit> unitMap;
	private HashMap<Position, City> cityMap;
	
	public DeltaCivFactory() {
		tileMap = new DeltaTileMap(new String[] {
							          "...ooo..........",
							          ".ooooo.ooohooM..",
							          ".ooooo.oohooof..",
							          "offfoooo.offoooo",
							          "oooooooo...ooooo",
							          ".ooMMMoooo......",
							          ".....ooooooooo..",
							          "...ooMooooo.....",
							          "..ohhoooofffoo..",
							          "...ofooohhoooo..",
							          ".oooooMooo...oo.",
							          ".ooMMMoooo..oooo",
							          ".ofoofooooohhoo.",
							          "..ooooooffoooo..",
							          "....ooooooooo...",
							          "..ooohhoo.......",
							         });
		unitMap = new HashMap<Position, Unit>();
		unitMap.put(new Position(1,3), new UnitImpl(GameConstants.LEGION, Player.RED));
		unitMap.put(new Position(4,4), new UnitImpl(GameConstants.ARCHER, Player.BLUE));
		
		cityMap = new HashMap<Position, City>();
		cityMap.put(new Position(4, 0), new CityImpl(Player.RED, GameConstants.ARCHER, GameConstants.productionFocus));
		cityMap.put(new Position(7,7), new CityImpl(Player.BLUE, GameConstants.ARCHER, GameConstants.productionFocus));
	}
	
	public DeltaCivFactory(TileMap tileMap, HashMap<Position,Unit> unitMap, HashMap<Position, City> cityMap) {
		this.tileMap = tileMap;
		this.unitMap = unitMap;
		this.cityMap = cityMap;
	}
	
	@Override
	public TileMap tileMap() {
		return tileMap;
	}
	
	@Override
	public HashMap<Position, Unit> unitMap() {
		return unitMap;
	}

	@Override
	public HashMap<Position, City> cityMap() {
		return cityMap;
	}
}
